package cn.darkhorse.ticket.production.service;

import cn.darkhorse.ticket.production.pojo.BatchPersons;
import cn.darkhorse.ticket.production.pojo.TicketTask;
import cn.darkhorse.ticket.production.vo.TicketTaskListVO;
import cn.darkhorse.ticket.production.vo.TicketTaskScheduleVO;
import cn.darkhorse.ticket.production.vo.TicketTaskViewVO;
import com.baomidou.mybatisplus.extension.service.IService;
import lombok.Data;

import javax.annotation.security.DenyAll;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 工序任务 服务类
 * </p>
 *
 * @author wangxinghui
 * @since 2024-01-30
 */
public interface TicketTaskService extends IService<TicketTask> {
	
	
	/**
	 * 列表
	 * @param taskDTO
	 * @return
	 */
	List<TicketTaskListVO> list(TicketTaskDTO taskDTO);
	
	/**
	 * 保存
	 * @param ticketTasks
	 */
	void add(List<TicketTask> ticketTasks);
	
	/**
	 * 工单查看
	 * @param ticketCode
	 * @return
	 */
	List<TicketTaskListVO> viewOfTicketInfo(String ticketCode);
	
	/**
	 * 工单列表查看
	 * @param ticketCodes
	 * @return
	 */
	Map<String,List<TicketTaskScheduleVO>> viewOfTaskSchedule(List<String> ticketCodes);
	
	/**
	 * 查看
	 * @param id
	 * @return
	 */
	TicketTaskViewVO view(Long id);
	
	/**
	 * 批量设置质检人、 批量设置报工人
	 * @param personsDTO
	 * @param tableName
	 */
	void batchPersons(BatchPersonsDTO personsDTO,String tableName);
	
	
	/**
	 * 工单结束修改工序状态
	 * @param ticketCode
	 */
	void modifyProcedureStates(String ticketCode,Integer state);
	
	/**
	 * 工序自身修改状态
	 * @param id
	 * @param state
	 */
	void modifyProcedureStates(Long id,Integer state);
	
	/**
	 * 工单能否开始
	 * @param ticketCode
	 * @return  true 能 、false 否
	 */
	boolean isCanStartOfTicket(String ticketCode);
	
	
	@Data
	class TicketTaskDTO{
		String ticketCode;
		String procedureCode;
		String procedureName;
		Integer inspectionStates;
		Integer procedureStates;
	}
	

	
	
}
